import request from '@/utils/request'

// 查询挑拣任务列表
export function listPick(query) {
  return request({
    url: '/wms/pick/list',
    method: 'get',
    params: query
  })
}

// 初始化
export function initBean(query) {
    return request({
        url: '/wms/pick/initBean',
        method: 'post',
        params: query
    })
}

export function initBeanByDeal(query) {
    return request({
        url: '/wms/pick/initBeanByDeal',
        method: 'post',
        params: query
    })
}

// 查询挑拣任务详细
export function getPick(id) {
  return request({
    url: '/wms/pick/' + id,
    method: 'get'
  })
}
// 查询上架任务详细
export function getPickTask(id) {
  return request({
    url: '/wms/pick/getTaskInfo/' + id,
    method: 'get'
  })
}

// 新增挑拣任务
export function addPick(data) {
  return request({
    url: '/wms/pick',
    method: 'post',
    data: data
  })
}

// 修改挑拣任务
export function updatePick(data) {
  return request({
    url: '/wms/pick',
    method: 'put',
    data: data
  })
}

// 删除挑拣任务
export function delPick(id) {
  return request({
    url: '/wms/pick/' + id,
    method: 'delete'
  })
}

//拆箱
export function delUnpacking(boxId,id) {
  return request({
    url: '/wms/pick/unpacking/' + boxId+'/'+id,
    method: 'post'
  })
}
